
#include "IpmiHeader.h"
#include "Debug.h"

#if XDEBUG
void IpmiHeader_Dump(IpmiHeader* pRqIpmiHeader, uint32 level)
{
	TRACE_LEVEL(level, ("cmd=0x%x, rqSeq=0x%x, rqSA=0x%x\n"
		, pRqIpmiHeader->m_Cmd
		, pRqIpmiHeader->m_Seq
		, pRqIpmiHeader->m_NetFn));
}
#endif

Bool IpmiHeader_IsMatch(IpmiHeader* pRqIpmiHeader, IpmiHeader* pRsIpmiHeader)
{
	return(    pRsIpmiHeader->m_Lun		== pRqIpmiHeader->m_Lun
			&& pRsIpmiHeader->m_NetFn 	== pRqIpmiHeader->m_NetFn + 1
			&& pRsIpmiHeader->m_Seq  	== pRqIpmiHeader->m_Seq
			&& pRsIpmiHeader->m_Cmd 	== pRqIpmiHeader->m_Cmd
			);
}

void IpmiHeader_Init(IpmiHeader* pRqIpmiHeader, uint8 Cmd, uint8 NetFn, uint8 Lun)
{
	pRqIpmiHeader->m_Cmd = Cmd;
	pRqIpmiHeader->m_NetFn = NetFn;
	pRqIpmiHeader->m_Lun = Lun;
}



